Skip to content

Conversation

@TimilsinaBimal
Copy link
Owner

No description provided.

TimilsinaBimal and others added 30 commits November 23, 2025 21:57
…p cloning for catalog data in the frontend, removing conditional name handling.
…and apply them during catalog generation (#21)

* feat: Add genre exclusion UI, store excluded genres in user settings, and apply them during catalog generation.

* refactor: simplify filtering recommendations by excluded genres using list comprehension

* refactor: streamline genre exclusion logic for similarity recommendations
…t and section navigation (#22)

* feat: Rework UI into a multi-step setup wizard with Watchly account management and section navigation
* critical: check if user already exists

* refactor: remove disabled class from source code button
… fetching, replacing credential-derived tokens and direct login. (#25)
* feat: add option to rename, enable disable catalogs

* feat: add option to rename, enable disable catalogs

* feat: Implement user ID-based token management and Stremio user info fetching, replacing credential-derived tokens and direct login.

* feat: Implement user ID-based token management and Stremio user info fetching, replacing credential-derived tokens and direct login.

* feat: Refactor token management to use a dedicated token model, remove token salt, and streamline catalog refresh logic.

* feat: Encrypt auth keys in token store and enforce 401 for invalid tokens across endpoints.

* feat: Introduce token redaction utility and apply it to log messages for enhanced security.

* feat: Introduce token redaction utility and apply it to log messages for enhanced security.
@vercel
Copy link

vercel bot commented Dec 12, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
watchly Ready Ready Preview Comment Dec 12, 2025 10:19am

@gemini-code-assist
Copy link

Summary of Changes

Hello @TimilsinaBimal, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request delivers a comprehensive upgrade to the Watchly addon, transforming its recommendation capabilities and user experience. The core recommendation logic has been advanced to a hybrid model, leveraging user taste profiles and AI for more intelligent content discovery. Users now benefit from a modern, interactive web interface for configuring their preferences, including language, genre exclusions, and personalized catalog management. Under the hood, the system boasts improved security for user data, robust API communication with retry mechanisms, and a streamlined development and deployment process through the adoption of 'uv' for dependency management.

Highlights

  • Hybrid Recommendation System: Implemented a sophisticated system combining item-based similarity and profile-based discovery for more accurate and diverse recommendations, leveraging new scoring and user profiling services.
  • Dynamic & Customizable Catalogs: Introduced AI-powered dynamic catalog rows based on user taste profiles (genres, keywords, countries, years) with customizable names and order, enhancing content discovery.
  • Modern Configuration UI: Overhauled the user interface for addon configuration, offering a more intuitive and feature-rich experience with options for language, genre exclusion, RPDB API key, and personalized catalog management.
  • Secure & Migratable User Data: Enhanced token storage security, enabled migration of existing user data to the new format, and improved API call reliability with robust retry mechanisms.
  • Optimized Build Process: Adopted 'uv' for Python dependency management, significantly speeding up Docker image builds and streamlining local development workflows.
Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/ci.yml
    • .github/workflows/release.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a major refactor and feature enhancement to the Watchly addon, primarily focusing on improved user experience, customization, and backend efficiency. Key changes include migrating the Docker build process to use uv for faster dependency management, a complete overhaul of the README.md to reflect new features and installation methods, and significant updates to the API endpoints.

The catalog generation logic (app/api/endpoints/catalogs.py, app/api/endpoints/manifest.py) now supports dynamic catalog types (e.g., theme-based, item-based) and integrates user-specific settings like language and genre exclusions. The token management (app/api/endpoints/tokens.py) has been redesigned to use Stremio authKey exclusively, removing username/password fields, and now stores user settings directly with the token, including new options for RPDB API keys and genre exclusions. A new /api/languages endpoint was added for language selection in the UI.

Backend services have been expanded with new modules for DiscoveryEngine, RPDBService, ScoringService, TranslationService, and UserProfileService, enabling more sophisticated recommendation algorithms and internationalization. The TokenStore was refactored to use user_id as the primary key for storing credentials, and a migration script was added to handle existing tokens. The frontend UI (app/static/index.html, app/static/script.js) received a complete redesign with a multi-step configuration flow, dynamic catalog reordering, genre exclusion options, and improved feedback mechanisms.

Review comments highlighted concerns about the removal of Python environment variables from the Dockerfile (suggesting they be re-added for consistency), the inefficiency of creating new TMDBService instances per request in app/api/endpoints/meta.py (recommending FastAPI's dependency injection), and a potential reduction in recommendation availability due to the strict requirement for imdb_id in app/services/recommendation_service.py.

I am having trouble creating individual review comments. Click here to see my feedback.

Dockerfile (8-11)

medium

These environment variables (PYTHONDONTWRITEBYTECODE, PYTHONUNBUFFERED, etc.) are generally good practice for Python applications in Docker to optimize performance and logging. While uv might handle some of these implicitly, it's safer to set them explicitly to ensure consistent behavior. Consider re-adding them to the new Dockerfile.

ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1

app/api/endpoints/meta.py (10-24)

medium

Creating a new TMDBService instance on every request to this endpoint is inefficient, as it creates a new httpx.AsyncClient each time, preventing connection pooling. It's better to use FastAPI's dependency injection system to manage the lifecycle of services like this.

For example, you could create a dependency provider for TMDBService and inject it into your route function.

app/models/token.py (1-11)

medium

This file appears to be unused. The models UserSettings and Credentials are defined and imported from app/core/settings.py throughout the application. To improve maintainability and reduce clutter, consider removing this redundant file.

app/services/recommendation_service.py (178-181)

medium

The logic now requires an imdb_id to create a stremio_id and skips content that doesn't have one. This is a significant change that could reduce the number of available recommendations, especially for newer or international content that might only have a TMDB ID.

If this is the intended behavior, consider adding a comment to explain the reasoning. Otherwise, you might want to revert to a fallback mechanism, such as stremio_id = imdb_id if imdb_id else f"tmdb:{details.get('id')}".

@TimilsinaBimal TimilsinaBimal merged commit 1a75bdf into main Dec 12, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants